//
//  WBWebViewController.swift
//  仿写微博
//
//  Created by Apple on 17/8/17.
//  Copyright © 2017年 tuimao. All rights reserved.
//

import UIKit

import WebKit

class WBWebViewController: WBBaseViewController {
    /// 懒加载webView
    fileprivate lazy var webView = WKWebView(frame: UIScreen.main.bounds)
    /// 加载url字符串
    var urlString:String?{
        didSet{
           guard let urlString = urlString,
                      let url = URL(string: urlString)else{
                return
            }
            print(url)
            webView.load(URLRequest(url: url))
        }
    }
}

extension WBWebViewController{
    
    override func setupTableView() {
        navItem.title = "网页"
        view.insertSubview(webView, belowSubview: navigationBar)
        webView.backgroundColor = UIColor.white
        webView.scrollView.contentInset.top = navigationBar.bounds.height
    }
}
